import request from '../http/axios'

//获取视频列表
export function listRecordings(params) {
  return request({
    url: '/api/video/list_recordings',
    method: 'get',
    params,
  })
}
//删除视频
export function deleteRecording(params, name) {
  return request({
    url: '/api/video/delete_recording/' + name,
    method: 'DELETE',
    params,
  })
}

//设置视频透视校正点
export function setVideoPoint(data) {
  return request({
    url: 'api/video/correction/corners',
    method: 'post',
    data,
  })
}
//启用禁用视频透视矫正
export function setVideoCorrection(data) {
  return request({
    url: 'api/video/correction/enable',
    method: 'post',
    data,
  })
}
//开启录制
export function startRecording(data) {
  return request({
    url: 'api/video/start_recording',
    method: 'post',
    data,
  })
}
//结束录制
export function stopRecording(data) {
  return request({
    url: 'api/video/stop_recording',
    method: 'post',
    data,
  })
}
//视频导出
export function exportRecording(params, name) {
  return request({
    url: 'api/video/export_recording/' + name,
    method: 'get',
    params,
  })
}
//视频导出
export function correctionCorners(data) {
  return request({
    url: 'api/video/correction/corners',
    method: 'post',
    data,
  })
}
//设置视频旋转
export function setVideoRotation(data) {
  return request({
    url: 'api/video/rotation',
    method: 'post',
    data,
  })
}
//启动视频流
export function startVideo(data) {
  return request({
    url: 'api/video/start',
    method: 'post',
    data,
  })
}
//停止视频流
export function stopVideo(data) {
  return request({
    url: 'api/video/stop',
    method: 'post',
    data,
  })
}

// 更改位置
export function updateLocation(module_id, val) {
  return request({
    url: `/api/modules/${module_id}/position`,
    method: 'put',
    data: {
      position: val,
    },
  })
}

//重置实时圆形图案显示信息为0值

export function resetToZero(params) {
  return request({
    url: `/api/video/circular_pattern/realtime/reset_to_zero`,
    method: 'get',
    params,
  })
}
